package com.als;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;


public class AlsDB {
   static String driverName = "com.mysql.cj.jdbc.Driver";
   static String dbURL = "jdbc:mysql://192.40.10.187:3366/springbootjlvpc?useUnicode=true&characterEncoding=utf-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC";//数据库连接
   static String userName = "root";//数据库用户名
   static String userPwd = "HT706@ht706!@#";//数据库密码
   private static Connection Conn = null;

   public static void getClose(ResultSet rs, Statement st, Connection c) {
      try {
         if (rs != null) rs.close();
         if (st != null) st.close();
         if (c != null) c.close();
      } catch (Exception e) {
      }
   }

   public static Connection getConn(){
      try {
         Class.forName(driverName);
         Conn = DriverManager.getConnection(dbURL, userName, userPwd);
      } catch (Exception e) {
         e.printStackTrace();
      }
      return Conn;
   }
}
   